xen/memory: Reject out-of-range resource 'frame' values
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 28 Jan 2021 14:39:25 +0000 (14:39 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 30 Jan 2021 03:21:33 +0000 (03:21 +0000)
commit25164f35789c38cf53e08259350f23608aaef367
tree88b057399b2ece2bd85233b8a2c6f0863b321e53
parente402441d4c02908cea9c14392fd7c2831c0456d0
xen/memory: Reject out-of-range resource 'frame' values

The ABI is unfortunate, and frame being 64 bits leads to all kinds of problems
performing correct overflow checks.

Reject out-of-range values, and combinations which overflow, and use unsigned
int consistently elsewhere.  This fixes several truncation bugs in the grant
call tree, as the underlying limits are expressed with unsigned int to begin
with.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/grant_table.c
xen/common/ioreq.c
xen/common/memory.c
xen/include/xen/grant_table.h
xen/include/xen/ioreq.h